
s = "Hello World"

print(s[0])  # Output: H
print(s[1:5])  # Output: ello
print(s[-1])  # Output: d
print(s[6:])  # Output: World
print(s[:5])  # Output: Hello
print(s[::2])  # Output: Hlo ol
print(s[::-1])  # Output: dlroW olleH   
print(s.upper())  # Output: HELLO WORLD
print(s.lower())  # Output: hello world
print(s.replace("World", "Python"))  # Output: Hello Python
print(s.split())  # Output: ['Hello', 'World']
print(s.find("World"))  # Output: 6
print(s.count("o"))  # Output: 2
print(s.startswith("Hello"))  # Output: True
print(s.endswith("World"))  # Output: True
print(s.strip())  # 去除首尾空格
print(s.title())  # Output: Hello World
print(s.capitalize())  # Output: Hello world
print(s.isalpha())  # Output: False (包含空格)
print(s.isdigit())  # Output: False (包含字母)
print(s.isalnum())  # Output: False (包含空格)
print(s.islower())  # Output: False (包含大写字母)
print(s.isupper())  # Output: False (包含小写字母)
print(s.split(" "))  # Output: ['Hello', 'World']
print(s.join(['Python', 'is', 'great']))  # Output: Python is greatHello World
print(s.index("World"))  # Output: 6